package cn.hznc.domain.request.program;

import cn.hznc.domain.entity.ProgramEntity;
import cn.hznc.domain.entity.SubProgramEntity;
import cn.hznc.utils.factory.ExcelExportStrategy;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * @Author：Administrator
 * @Date：2023/12/14 16:50
 */
@Getter
@Setter
public class ExportSubprogramListReq  implements ExcelExportStrategy{

    private ProgramEntity programEntity;

    private List<SubProgramEntity> subProgramEntityList;

    private ExportSubprogramVo exportSubprogramVo;

    @Override
    public ExcelWriter buildExcelWrite(ExcelWriter excelWriter, FillConfig fillConfig, WriteSheet writeSheet) {
        // 列表
        excelWriter.fill(this.programEntity, fillConfig, writeSheet);

        excelWriter.fill(this.subProgramEntityList, writeSheet);
        return excelWriter;
    }
}
